﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.Generic;

namespace Nok_Air
{
    public class AvailabilityItemViewModel : INotifyPropertyChanged
    {
        private DateTime _Date;
        public DateTime Date
        {
            get
            {
                return _Date;
            }
            set
            {
                if (value != _Date)
                {
                    _Date = value;
                    NotifyPropertyChanged("Date");
                }
            }
        }




        private List<FlightSegmentItemViewModel> _FlightSegmentItem;
        public List<FlightSegmentItemViewModel> FlightSegmentItem
        {
            get
            {
                return _FlightSegmentItem;
            }
            set
            {
                if (value != _FlightSegmentItem)
                {
                    _FlightSegmentItem = value;
                    NotifyPropertyChanged("FlightSegmentItem");
                }
            }
        }     

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
    public class FlightSegmentItemViewModel : INotifyPropertyChanged
    {
        public string From
        {
            get
            {
                return App.ViewModel.From;
            }
            //   set; 
        }
        public string To
        {
            get
            {
                return App.ViewModel.To;
            }
            //   set; 
        }
        public string Date
        {
            get
            {
                return App.ViewModel.Date;
            }
            //   set; 
        }
        public string Time
        {
            get
            {
                return App.ViewModel.Time;
            }
            //   set; 
        }
        public string Flight
        {
            get
            {
                return App.ViewModel.FlightNo;
            }
            //   set; 
        }
        /*<ReturnCode>0</ReturnCode> 
         * <ODNo>1</ODNo> 
         * <SegmentNo>1</SegmentNo> 
         * <CityPairNo>650</CityPairNo> 
         * <DepartureCity>DMK</DepartureCity> 
         * <ArrivalCity>CNX</ArrivalCity> 
         * <FlightNumber>DD8300</FlightNumber> 
         * <BoardDate>2007-08-23</BoardDate> 
         * <DepartureAirport>DMK</DepartureAirport> 
         * <ArrivalAirport>CNX</ArrivalAirport> 
         * <FlightPathCode>D</FlightPathCode> 
         * <DepartureTime>06:15</DepartureTime> 
         * <ArrivalTime>07:20</ArrivalTime> 
         * <DateChangeIndicator>0</DateChangeIndicator> 
         * <DepartureTerminalNo>D</DepartureTerminalNo> 
         * <ArrivalTerminalNo>1</ArrivalTerminalNo> 
         * <NoOfStops>0</NoOfStops> 
         * <AircraftCode>734</AircraftCode> 
         * <Distance>0</Distance> <DistanceUOM /> 
         * <FlightNotesFlag>0</FlightNotesFlag> 
         * <FlightNotes />
         * <JourneyTime>65</JourneyTime>
         * <StopOverHours>0</StopOverHours>
         * <TotalJourneyTime>65</TotalJourneyTime>
         * <NoOfConnections>0</NoOfConnections> 
         * <ReturnFlightFlag>0</ReturnFlightFlag> 
         * <Classes>*/
        private string _DepartureAirport;
        public string DepartureAirport
        {
            get
            {
                return _DepartureAirport;
            }
            set
            {
                if (value != _DepartureAirport)
                {
                    _DepartureAirport = value;
                    NotifyPropertyChanged("DepartureAirport");
                }
            }
        }private string _ArrivalAirport;
        public string ArrivalAirport
        {
            get
            {
                return _ArrivalAirport;
            }
            set
            {
                if (value != _ArrivalAirport)
                {
                    _ArrivalAirport = value;
                    NotifyPropertyChanged("ArrivalAirport");
                }
            }
        }
        private string _FlightNumber;
        public string FlightNumber
        {
            get
            {
                return _FlightNumber;
            }
            set
            {
                if (value != _FlightNumber)
                {
                    _FlightNumber = value;
                    NotifyPropertyChanged("FlightNumber");
                }
            }
        }

        private string _DepartureTime;
        public string DepartureTime
        {
            get
            {
                return _DepartureTime;
            }
            set
            {
                if (value != _DepartureTime)
                {
                    _DepartureTime = value;
                    NotifyPropertyChanged("DepartureTime");
                }
            }
        }

        private string _ArrivalTime;
        public string ArrivalTime
        {
            get
            {
                return _ArrivalTime;
            }
            set
            {
                if (value != _ArrivalTime)
                {
                    _ArrivalTime = value;
                    NotifyPropertyChanged("ArrivalTime");
                }
            }
        }

        private string _BoardDate;
        public string BoardDate
        {
            get
            {
                return _BoardDate;
            }
            set
            {
                if (value != _BoardDate)
                {
                    _BoardDate = value;
                    NotifyPropertyChanged("BoardDate");
                }
            }
        }

        private string _TotalJourneyTime;
        public string TotalJourneyTime
        {
            get
            {
                return _TotalJourneyTime;
            }
            set
            {
                if (value != _TotalJourneyTime)
                {
                    _TotalJourneyTime = value;
                    NotifyPropertyChanged("TotalJourneyTime");
                }
            }
        }

        private FSegSellingClass _ClassNokPlus;
        public FSegSellingClass ClassNokPlus
        {
            get
            {
                return _ClassNokPlus;
            }
            set
            {
                if (value != _ClassNokPlus)
                {
                    _ClassNokPlus = value;
                    NotifyPropertyChanged("ClassNokPlus");
                }
            }
        }
        private FSegSellingClass _ClassFlexi;
        public FSegSellingClass ClassFlexi
        {
            get
            {
                return _ClassFlexi;
            }
            set
            {
                if (value != _ClassFlexi)
                {
                    _ClassFlexi = value;
                    NotifyPropertyChanged("ClassFlexi");
                }
            }
        }
        private FSegSellingClass _ClassEconomy;
        public FSegSellingClass ClassEconomy
        {
            get
            {
                return _ClassEconomy;
            }
            set
            {
                if (value != _ClassEconomy)
                {
                    _ClassEconomy = value;
                    NotifyPropertyChanged("ClassEconomy");
                }
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }    
    }

    public class FSegSellingClass : INotifyPropertyChanged
    {

       /*<SellingClass><ClassCode>J</ClassCode> <SeatCount>12</SeatCount> <FareCode>J1R</FareCode> <FareValue>1308.41</FareValue> <TaxValue>0.00</TaxValue> <RefundableFlag>0</RefundableFlag> <FloatingFareFlag>1</FloatingFareFlag> <FloatingBaseClass>L</FloatingBaseClass> <Cabin>C</Cabin></SellingClass>*/

        private string _ClassName;
        public string ClassName
        {
            get
            {
                return _ClassName;
            }
            set
            {
                if (value != _ClassName)
                {
                    _ClassName = value;
                    NotifyPropertyChanged("ClassName");
                }
            }
        }
        private string _ClassCode;
        public string ClassCode
        {
            get
            {
                return _ClassCode;
            }
            set
            {
                if (value != _ClassCode)
                {
                    _ClassCode = value;
                    NotifyPropertyChanged("ClassCode");
                }
            }
        }
        
        private string _SeatCount;
        public string SeatCount
        {
            get
            {
                return _SeatCount;
            }
            set
            {
                if (value != _SeatCount)
                {
                    _SeatCount = value;
                    NotifyPropertyChanged("SeatCount");
                }
            }
        }

        private string _FareCode;
        public string FareCode
        {
            get
            {
                return _FareCode;
            }
            set
            {
                if (value != _FareCode)
                {
                    _FareCode = value;
                    NotifyPropertyChanged("FareCode");
                }
            }
        }

        private string _FareValue;
        public string FareValue
        {
            get
            {
                return _FareValue;
            }
            set
            {
                if (value != _FareValue)
                {
                    _FareValue = value;
                    NotifyPropertyChanged("FareValue");
                }
            }
        }

        private string _TaxValue;
        public string TaxValue
        {
            get
            {
                return _TaxValue;
            }
            set
            {
                if (value != _TaxValue)
                {
                    _TaxValue = value;
                    NotifyPropertyChanged("TaxValue");
                }
            }
        }

        private string _RefundableFlag;
        public string RefundableFlag
        {
            get
            {
                return _RefundableFlag;
            }
            set
            {
                if (value != _RefundableFlag)
                {
                    _RefundableFlag = value;
                    NotifyPropertyChanged("RefundableFlag");
                }
            }
        }

        private string _FloatingFareFlag;
        public string FloatingFareFlag
        {
            get
            {
                return _FloatingFareFlag;
            }
            set
            {
                if (value != _FloatingFareFlag)
                {
                    _FloatingFareFlag = value;
                    NotifyPropertyChanged("FloatingFareFlag");
                }
            }
        }

        private string _FloatingBaseClass;
        public string FloatingBaseClass
        {
            get
            {
                return _FloatingBaseClass;
            }
            set
            {
                if (value != _FloatingBaseClass)
                {
                    _FloatingBaseClass = value;
                    NotifyPropertyChanged("FloatingBaseClass");
                }
            }
        }

        private string _Cabin;
        public string Cabin
        {
            get
            {
                return _Cabin;
            }
            set
            {
                if (value != _Cabin)
                {
                    _Cabin = value;
                    NotifyPropertyChanged("Cabin");
                }
            }
        }

        private string _IsEnable;
        public string IsEnable
        {
            get
            {
                return _IsEnable;
            }
            set
            {
                if (value != _IsEnable)
                {
                    _IsEnable = value;
                    NotifyPropertyChanged("IsEnable");
                }
            }
        }
        private string _GroupRadioBT;
        public string GroupRadioBT
        {
            get
            {
                return _GroupRadioBT;
            }
            set
            {
                if (value != _GroupRadioBT)
                {
                    _GroupRadioBT = value;
                    NotifyPropertyChanged("GroupRadioBT");
                }
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}